<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<style>
			#hd{
				width: 300px;
				height: 500px;
				background: red;
				margin: 0 auto;
			}
		</style>
		<script src='jquery-3.4.1.js'></script>
		<script>
			$(function(){
				$("#hd").mouseenter(function(){
					timer=setTimeout(function(){
						alert('哈哈哈哈');
					},100)
				})
				$("#hd").mouseleave(function(){
					//清理定时器
					clearTimeout(timer);
				})
			})
		</script>
	</head>
	<body>
		<div id='hd'>
			
		</div>
	</body>
</html>
